<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>main</title>
    <link rel="stylesheet" href="../public/css/admin/admin.css">
    <script type="text/javascript" src="../public/js/jquery-1.10.2.js"></script>
    <script type="text/javascript" src="../public/js/admin/admin.js"></script>

</head>
<body id="main">
<div class="map">
    管理首页 &gt;&gt; 等级管理 &gt;&gt; <span class="title">{$title}</span>
</div>

<ol class="subnav clear">
    <li class="selected"><a href="main_home_level.php?action=show">等级列表</a></li>
    <li><a href="main_home_level.php?action=add">新增等级</a></li>
    {if $update}
    <li><a href="main_home_level.php?action=update&id={$data->id}">修改等级</a></li>
    {/if}
</ol>

<!-- 显示等级 -->
{if $show}
    <table class="list" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <th width="10%">序号</th>
            <th width="20%">名称</th>
            <th >说明</th>
            <th width="10%">操作</th>
        </tr>
        {if $data}
            {foreach $data(key,row)}
                <tr>
                    <!--<td>{@row->id}</td>-->
                    <td><script type="text/javascript">window.document.write( {@key+1} + {$page_base} );</script></td>
                    <td>{@row->level_name}</td>
                    <td>{@row->level_info}</td>
                    <td>
                        <a  href="main_home_level.php?action=update&id={@row->id}">修改</a> |
                        <a onclick="return confirm('确定删除该记录吗？');" href="main_home_level.php?action=delete&id={@row->id}">删除</a>
                    </td>
                </tr>
            {/foreach}
        {else}
            <tr><td colspan="8">对不起，没有找到任何数据</td></tr>
        {/if}
    </table>
    <!-- <p class="add_user">[ <a href="main_home_level.php?action=add">新增等级</a> ]</p> -->
    <p id="page"> {$page} </p>
{/if}

<!-- 新增等级 -->
{if $add}
    <form action="main_home_level.php?action=add" class="level_add"  method="post">
        <input type="hidden" name="prev_url" value="{#PREV_URL}" />
        <table class="form" border="0">
            <tr>
                <td>等级名称：</td>
                <td><input type="text" class="text" name="level_name" value=""/> ( * 等级名称不能大于20位 )</td>
            <tr>
                <td>等级说明：</td>
                <td>
                        <!--<input type="text" class="text" name="level_info" value=""/>-->
                    <textarea name="level_info" class="level_info"></textarea>
                        ( * 等级说明不能大于200位 )</td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <input type="submit" name="send" class="send" value="新增等级" />   [ <a href="{#PREV_URL}">返回列表</a> ]
                </td>
            </tr>
        </table>

    </form>
{/if}

<!-- 更新等级 -->
{if $update}
    <form action="main_home_level.php?action=update" class="level_update"  method="post">
        <input type="hidden" id="id" name="id"  value="{$data->id}" />
        <input type="hidden" name="prev_url" value="{#PREV_URL}" />
        <table class="form" border="0">
            <tr>
                <td>等级名称：</td>
                <td><input type="text"  class="text" name="level_name" value="{$data->level_name}"/>
                    ( * 等级名称不能大于20位 )</td>
            <tr>
                <td>等级说明：</td>
                <td>
                    <!--<input type="text" class="text" name="level_info" value=""/>-->
                    <textarea name="level_info" class="level_info">{$data->level_info}</textarea>
                    ( * 等级说明不能大于200位 )</td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <input type="submit" name="send" class="send" value="修改等级" />   [ <a href="{#PREV_URL}">返回列表</a> ]
                </td>
            </tr>
        </table>

    </form>
{/if}


</body>
</html>